package com.glacier.cloud.cart.config;

import com.glacier.cloud.cart.consts.Constant;
import com.glacier.cloud.cart.consumer.OrderCreateEventConsumer;
import com.glacier.cloud.cart.consumer.StrConsumer;
import com.glacier.cloud.cart.entity.event.OrderCreateEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Consumer;

/**
 * date 2024-01-24 22:05
 *
 * @author glacier
 * @version 1.0
 */
@Configuration
public class ConsumerConfig {
    @Bean(Constant.ORDER)
    public Consumer<OrderCreateEvent> consumer1() {
        return new OrderCreateEventConsumer();
    }

    @Bean(Constant.ORDER1)
    public Consumer<String> consumer2() {
        return new StrConsumer();
    }
}
